package com.bravo.mvp.ui.main;

/**
 * Created by Administrator on 2017/8/7.
 */

public class MainModuleImp implements MainModule {
    private ModuleListener listener;

    public MainModuleImp(ModuleListener listener) {
        this.listener = listener;
    }

    @Override
    public void doAdd(int number) {
        if (number >= 0 && number < 10) {
            listener.addFinish(++number);
        } else {
            listener.onAddError(new Exception("Number can not be a minus or bigger than 10 !"));
        }
    }
}
